package com.cc.service.impl;


import com.cc.mapper.ProductCategoryMapper;
import com.cc.model.EbProductCategory;
import com.cc.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductCategoryServiceImpl implements ProductCategoryService {
    @Autowired
    private ProductCategoryMapper productCategoryMapper;

    @Override
    public List<EbProductCategory> list(int page, int pageSize) {
        return productCategoryMapper.listByPage((page - 1) * pageSize, pageSize);
    }
    @Override
    public int getMaxPage(int pageSize) {

        return productCategoryMapper.getMaxPage(pageSize);
    }
    @Override
    public int save(EbProductCategory ebProductCategory) {

        return productCategoryMapper.save(ebProductCategory);
    }

    @Override
    public EbProductCategory selectByCondition(Integer epcId) {

        return productCategoryMapper.listById(epcId);
    }

    @Override
    public int updateById(EbProductCategory ebProductCategory){
        return productCategoryMapper.updateByPrimaryKey(ebProductCategory);
    }
    @Override
    public int deleteByPk(Integer id){

        return productCategoryMapper.delete(id);
    }

    @Override
    public List<EbProductCategory> bigProductCategorys() {
        return productCategoryMapper.findBigProductCategory();
    }

    @Override
    public List<EbProductCategory> smallProductCategorys() {
        return productCategoryMapper.findSmallProductCategory();
    }

}
